package com.gmail.ceac13;

import com.google.android.maps.*;
import android.os.Bundle;

public class MapaActivity extends MapActivity {
	/** Called when the activity is first created. */
	


	@SuppressWarnings("deprecation")
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//MapView mapView = new MapView(this, "0g4ay15pik-2_Nilz5h4DfUECimWFWjOvzlFjYA");
		//setContentView(R.layout.mapa);
		
		Bundle extras = getIntent().getExtras();
		String posicao = extras.getString("posicao");
		String [] posicoes = posicao.split(",");
		
		
		
		setContentView(R.layout.mapa);
		MapView mapView = (MapView) findViewById(R.id.mapview);
		mapView.setStreetView(true);
		mapView.setClickable(true);
		MapController mc = mapView.getController();
		double latitude = Double.parseDouble(posicoes[0]);
		double longitude = Double.parseDouble(posicoes[1]);
		int latitudeE6 = (int) (latitude*1E6);
		int longitudeE6 = (int) (longitude*1E6);
		GeoPoint point = new GeoPoint(latitudeE6, longitudeE6);
		ImagemOverlay imagem = new ImagemOverlay(point, R.drawable.ponto);
		mapView.getOverlays().add(imagem);
		mc.setCenter(point);
		mc.animateTo(point);
		mc.setZoom(16);
		
	}
	@Override
	protected boolean isRouteDisplayed() {
		return false;
	}
}
